function $(a) {
  return document.querySelector(a);
}
var tbody = document.querySelector("tbody");

// 点击显示数据每页几条
$(".pageSize").onchange = function () {
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  fenye(1, $(".pageSize").value);
};
$(".pageSize1").onchange = function () {
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  searchdata(1, $(".pageSize1").value);
};
// 预览大图片
function displayphoto1(a, list) {
  var videophoto = document.querySelectorAll(a);
  for (let j = 0; j < videophoto.length; j++) {
    videophoto[j].onclick = function () {
      console.log(j);
      $(".bigphoto").src = list[j].videoPhoto;
      $(".photo-box").style.display = "block";
      // 退出照片预览
      $(".back4").onclick = function () {
        $(".photo-box").style.display = "none";
      };
    };
  }
}
// 简介字数太多隐藏
function str(b) {
  let s = "";
  if (b.length >= 15) {
    for (let i = 0; i < 15; i++) {
      s += b[i];
    }
    s += "...";
  } else {
    for (let i = 0; i < b.length; i++) {
      s += b[i];
    }
  }
  return s;
}

$(".select").onchange = function () {
  if ($(".select").value == "0") {
    $(".select-input").value = 0;
    $(".select-input").style.display = "";
    $(".select1-input").style.display = "none";
    $(".select2-input").style.display = "none";
    $("#search").style.display = "";
    $("#search1").style.display = "none";
    $("#search2").style.display = "none";
    $("#search3").style.display = "none";
    $("#search4").style.display = "none";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "none";
    $(".alllist").onclick = function () {
      $(".pageSize").style.display = "block";
      $(".pageSize1").style.display = "none";
      $(".nowpage-1").innerHTML = 1;
      $(".nowpage").value = $(".nowpage-1").innerHTML;
      $("#search").value = "";
      fenye(1, $(".pageSize").value);
    };
    fenye(1, 10);
  } else if ($(".select").value == "1") {
    $(".select1-input").value = 0;
    $(".select-input").style.display = "none";
    $(".select1-input").style.display = "";
    $(".select2-input").style.display = "none";
    $("#search").style.display = "none";
    $("#search1").style.display = "none";
    $("#search2").style.display = "";
    $("#search3").style.display = "none";
    $("#search4").style.display = "none";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "none";
    $(".alllist").onclick = function () {
      $(".pageSize").style.display = "block";
      $(".pageSize1").style.display = "none";
      $(".nowpage-1").innerHTML = 1;
      $(".nowpage").value = $(".nowpage-1").innerHTML;
      $("#search").value = "";
      comment(1, $(".pageSize").value);
    };
    comment(1, 10);
  } else {
    $(".select2-input").value = 0;
    $(".select-input").style.display = "none";
    $(".select1-input").style.display = "none";
    $(".select2-input").style.display = "";
    $("#search").style.display = "none";
    $("#search1").style.display = "none";
    $("#search2").style.display = "none";
    $("#search3").style.display = "none";
    $("#search4").style.display = "";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "";
    $(".search5-btn").style.display = "none";
    $(".alllist").onclick = function () {
      $(".pageSize").style.display = "block";
      $(".pageSize1").style.display = "none";
      $(".nowpage-1").innerHTML = 1;
      $(".nowpage").value = $(".nowpage-1").innerHTML;
      $("#search").value = "";
      commentSon(1, $(".pageSize").value);
    };
    commentSon(1, 10);
  }
};
$(".select-input").onchange = function () {
  if ($(".select-input").value == "0") {
    $(".select-input").value = 0;
    $("#search").style.display = "";
    $("#search1").style.display = "none";
    $("#search2").style.display = "none";
    $("#search3").style.display = "none";
    $("#search4").style.display = "none";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "none";
  } else if ($(".select-input").value == "1") {
    $(".select-input").value = 1;
    $("#search").style.display = "none";
    $("#search1").style.display = "";
    $("#search2").style.display = "none";
    $("#search3").style.display = "none";
    $("#search4").style.display = "none";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "none";
  }
};
$(".select1-input").onchange = function () {
  if ($(".select1-input").value == "0") {
    $(".select1-input").value = 0;
    $("#search").style.display = "none";
    $("#search1").style.display = "none";
    $("#search2").style.display = "";
    $("#search3").style.display = "none";
    $("#search4").style.display = "none";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "none";
  } else if ($(".select1-input").value == "1") {
    $(".select1-input").value = 1;
    $("#search").style.display = "none";
    $("#search1").style.display = "none";
    $("#search2").style.display = "none";
    $("#search3").style.display = "";
    $("#search4").style.display = "none";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "none";
  }
};
$(".select2-input").onchange = function () {
  if ($(".select2-input").value == "0") {
    $(".select2-input").value = 0;
    $("#search").style.display = "none";
    $("#search1").style.display = "none";
    $("#search2").style.display = "none";
    $("#search3").style.display = "none";
    $("#search4").style.display = "";
    $("#search5").style.display = "none";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "";
    $(".search5-btn").style.display = "none";
  } else if ($(".select2-input").value == "1") {
    $(".select2-input").value = 1;
    $("#search").style.display = "none";
    $("#search1").style.display = "none";
    $("#search2").style.display = "none";
    $("#search3").style.display = "none";
    $("#search4").style.display = "none";
    $("#search5").style.display = "";
    $("#search").value = "";
    $("#search1").value = "";
    $("#search2").value = "";
    $("#search3").value = "";
    $("#search4").value = "";
    $("#search5").value = "";
    $(".search-btn").style.display = "none";
    $(".search1-btn").style.display = "none";
    $(".search2-btn").style.display = "none";
    $(".search3-btn").style.display = "none";
    $(".search4-btn").style.display = "none";
    $(".search5-btn").style.display = "";
  }
};
// // 渲染数据
function fenye(a, b) {
  axios({
    method: "get",
    url: "/video/findReportsVideo",
    params: {
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      $("tbody").innerHTML = "";
      $(".pageye").innerHTML = "";
      console.log(data.data.data.object.list);
      list(data, fenye);
    })
    .catch((err) => {
      console.log(err);
    });
}
fenye(1, 10);
// // 分页数据
function list(data, b) {
  let list = data.data.data.object.list;
  let pageNow = data.data.data.object.pageNow;
  // 视频遍历
  if ($(".select").value == "0") {
    $("thead").innerHTML = `<tr>
  <th><input name="checkbox" type="checkbox" value="checkbox" id="checkbox-all" /></th>
  <th>#</th>
  <th>视频名称</th>
  <th>视频封面</th>
  <th>视频地址</th>
  <th>举报人头像</th>
  <th>举报人</th>
  <th>举报时间</th>
  <th>举报理由</th>
  <th>是否处理</th>
  <th>操作</th>
</tr>`;
    for (let i = 0; i < list.length; i++) {
      var ofHandle, videoName;
      if (list[i].ofHandle == 0) {
        ofHandle = "未处理";
      } else if (list[i].ofHandle == 1) {
        ofHandle = "受理";
      } else {
        ofHandle = "不受理";
      }
      if (list[i].videoName == null) {
        videoName = "此视频已删除";
      } else {
        videoName = list[i].videoName;
      }
      if (list[i].ofHandle !== 0) {
        $("tbody").innerHTML += ` <tr>
          <td><input name="checkbox" type="checkbox" value="checkbox" class="chexkbox" /></td>
          <td>${i + 1 + (pageNow - 1) * $(".pageSize").value}</td>
          <td>${videoName}</td>
          <td><img src="${
            list[i].videoPhoto == null ? "#" : list[i].videoPhoto
          }"  style="width:50px; height:50px" class="photo11"></td>
          <td><a href='${
            list[i].videoPath == null ? "#" : list[i].videoPath
          }' style="text-decoration: none; font-weight:600;">${
          list[i].videoPath == null ? "无" : "链接"
        }</a></td>
          <td><img src="${
            list[i].userSrc == "未上传" ? "#" : list[i].userSrc
          }" style="width:40px;height:40px;border-radius: 50%;"></img></td>
          <td>${list[i].userNickname == null ? "无" : list[i].userNickname}</td>
          <td>${list[i].reportTime == null ? "无" : list[i].reportTime}</td>
          <td>${list[i].content == null ? "无" : str(list[i].content)}</td>
          <td>${ofHandle}</td>
          <td><button class='report-btn' style="color:rgb(83,83,83);cursor: not-allowed;"> 受理</button><button class='noreport-btn'style="color:rgb(83,83,83);cursor: not-allowed;"> 不受理</button><button class='delete-btn'><i class="fa fa-trash-o" aria-hidden="true"></i> 删除</button></td>
      </tr>`;
      } else {
        $("tbody").innerHTML += ` <tr>
          <td><input name="checkbox" type="checkbox" value="checkbox" class="chexkbox" /></td>
          <td>${i + 1 + (pageNow - 1) * $(".pageSize").value}</td>
          <td>${videoName}</td>
          <td><img src="${
            list[i].videoPhoto == null ? "#" : list[i].videoPhoto
          }"  style="width:50px; height:50px" class="photo11"></td>
          <td><a href='${
            list[i].videoPath == null ? "#" : list[i].videoPath
          }' style="text-decoration: none; font-weight:600;">${
          list[i].videoPath == null ? "无" : "链接"
        }</a></td>
          <td><img src="${
            list[i].userSrc == "未上传" ? "#" : list[i].userSrc
          }" style="width:40px;height:40px;border-radius: 50%;"></img></td>
          <td>${list[i].userNickname == null ? "无" : list[i].userNickname}</td>
          <td>${list[i].reportTime == null ? "无" : list[i].reportTime}</td>
          <td>${list[i].content == null ? "无" : str(list[i].content)}</td>
          <td>${ofHandle}</td>
          <td><button class='report-btn' > 受理</button><button class='noreport-btn'> 不受理</button><button class='delete-btn'><i class="fa fa-trash-o" aria-hidden="true"></i> 删除</button></td>
      </tr>`;
      }
      var tbr = tbody.querySelectorAll("tr");
      if (i % 2 == 0) {
        tbr[i].style.backgroundColor = "rgb(220, 220, 220)";
        tbr[i].onmouseover = function () {
          this.style.backgroundColor = "rgb(202, 170, 145)";
        };
        tbr[i].onmouseout = function () {
          this.style.backgroundColor = "rgb(220, 220, 220)";
        };
      }
    }
  }
  // 评论遍历
  else {
    $("thead").innerHTML = `<tr>
      <th><input name="checkbox" type="checkbox" value="checkbox" id="checkbox-all" /></th>
      <th>#</th>
      <th>评论内容</th>
      <th>举报人头像</th>
      <th>举报人</th>
      <th>举报时间</th>
      <th>举报理由</th>
      <th>是否处理</th>
      <th>操作</th>
    </tr>`;
    for (let i = 0; i < list.length; i++) {
      var ofHandle, commentContent;
      if (list[i].ofHandle == 0) {
        ofHandle = "未处理";
      } else if (list[i].ofHandle == 1) {
        ofHandle = "受理";
      } else {
        ofHandle = "不受理";
      }
      if (list[i].commentContent == null) {
        commentContent = "该评论已删除";
      } else {
        commentContent = list[i].commentContent;
      }
      if (list[i].ofHandle !== 0) {
        $("tbody").innerHTML += ` <tr>
            <td><input name="checkbox" type="checkbox" value="checkbox" class="chexkbox" /></td>
            <td>${i + 1 + (pageNow - 1) * $(".pageSize").value}</td>
            <td>${commentContent} </td>
            <td><img src="${
              list[i].userSrc == "未上传" ? "#" : list[i].userSrc
            }" style="width:40px;height:40px;border-radius: 50%;"></img></td>
            <td>${
              list[i].userNickname == null ? "无" : list[i].userNickname
            }</td>
            <td>${list[i].reportTime == null ? "无" : list[i].reportTime}</td>
            <td>${list[i].content == null ? "无" : str(list[i].content)}</td>
            <td>${ofHandle}</td>
            <td><button class='report-btn' style="color:rgb(83,83,83);cursor: not-allowed;"> 受理</button><button class='noreport-btn'style="color:rgb(83,83,83);cursor: not-allowed;"> 不受理</button><button class='delete-btn'><i class="fa fa-trash-o" aria-hidden="true"></i> 删除</button></td>
        </tr>`;
        if (list[i].commentContent == null) {
          $(".report-btn").disabled = true;
          $(".noreport-btn").disabled = true;
        }
      } else {
        $("tbody").innerHTML += ` <tr>
            <td><input name="checkbox" type="checkbox" value="checkbox" class="chexkbox" /></td>
            <td>${i + 1 + (pageNow - 1) * $(".pageSize").value}</td>
            <td>${commentContent} </td>
            <td><img src="${
              list[i].userSrc == "未上传" ? "#" : list[i].userSrc
            }" style="width:40px;height:40px;border-radius: 50%;"></img></td>
            <td>${
              list[i].userNickname == null ? "无" : list[i].userNickname
            }</td>
            <td>${list[i].reportTime == null ? "无" : list[i].reportTime}</td>
            <td>${list[i].content == null ? "无" : str(list[i].content)}</td>
            <td>${ofHandle}</td>
            <td><button class='report-btn' > 受理</button><button class='noreport-btn'> 不受理</button><button class='delete-btn'><i class="fa fa-trash-o" aria-hidden="true"></i> 删除</button></td>
        </tr>`;
        if (list[i].commentContent == null) {
          $(".report-btn").disabled = true;
          $(".noreport-btn").disabled = true;
        }
      }
      var tbr = tbody.querySelectorAll("tr");
      if (i % 2 == 0) {
        tbr[i].style.backgroundColor = "rgb(220, 220, 220)";
        tbr[i].onmouseover = function () {
          this.style.backgroundColor = "rgb(202, 170, 145)";
        };
        tbr[i].onmouseout = function () {
          this.style.backgroundColor = "rgb(220, 220, 220)";
        };
      }
    }
  }
  var report_btn = document.querySelectorAll(".report-btn");
  var noreport_btn = document.querySelectorAll(".noreport-btn");
  for (let i = 0; i < list.length; i++) {
    if (list[i].ofHandle == 1) {
      noreport_btn[i].style.display = "none";
      report_btn[i].style.display = "";
    } else if (list[i].ofHandle == 2) {
      noreport_btn[i].style.display = "";
      report_btn[i].style.display = "none";
    }
  }
  displayphoto1(".photo11", list);
  // 删除按钮绑定
  var del_btn = document.querySelectorAll(".delete-btn");
  for (let i = 0; i < del_btn.length; i++) {
    del_btn[i].onclick = function () {
      var x = 2;
      if ((x = 2)) {
        console.log(x);
        $(".form-pop").querySelector("p").innerHTML = "你确定要删除吗？";
        $(".pop-box").style.display = "block";
        $(".submit-pop1").onclick = function () {
          var reportId = list[i].reportId;
          delete_report(reportId, b);
          $(".pop-box").style.display = "none";
        };
        $(".submit-pop2").onclick = function () {
          $(".pop-box").style.display = "none";
        };
        $(".back-pop").onclick = function () {
          $(".pop-box").style.display = "none";
        };
      }
    };
  }

  // 受理举报
  var report_btn = document.querySelectorAll(".report-btn");
  for (let i = 0; i < report_btn.length; i++) {
    // if (list[i].ofHandle != 0) {
    //   report_btn[i].disabled = true;
    // }
    popup(report_btn[i], $(".video-box"), $(".back-video"));
    report_btn[i].onclick = function () {
      let videoId = list[i].videoId;
      if ($(".select").value == "0") {
        if (videoId == null) {
          report_btn[i].disabled = true;
          report_btn[i].style.color = "rgb(83, 83, 83)";
          report_btn[i].stylecursor = " not - allowed";
        } else {
          $(".table-video").innerHTML = `<div class="pop1-box">
          <div class="pop1-box-all">
              <h3>提示: </h3> <p class="back-pop1">×</p>
          <div class="form-pop1"> 
              <p>你确定要退出吗？</p>
              <button class="submit1-pop1">确定</button>
              <button class="submit1-pop2">取消</button>
          </div>
      </div>
      </div>
          <video width="100%" height="100%" controls>
      <source src="${list[i].videoPath}" type="video/mp4">
    </video>`;
          $(".delete-success").onclick = function () {
            var x = 3;
            if ((x = 3)) {
              console.log(x);
              $(".form-pop1").querySelector("p").innerHTML = "你确定要删除吗？";
              $(".pop1-box").style.display = "block";
              $(".submit1-pop1").onclick = function () {
                var reportId = list[i].reportId;
                delete_video(videoId);
                report(reportId, b);
                $(".video-box").style.display = "none";
                $(".pop1-box").style.display = "none";
              };
              $(".submit1-pop2").onclick = function () {
                $(".pop1-box").style.display = "none";
              };
              $(".back-pop1").onclick = function () {
                $(".pop1-box").style.display = "none";
              };
            }
          };
          $(".delete-nosuccess").onclick = function () {
            var x = 3;
            if ((x = 3)) {
              console.log(x);
              $(".form-pop1").querySelector("p").innerHTML =
                "你确定要不删除吗？";
              $(".pop1-box").style.display = "block";
              $(".submit1-pop1").onclick = function () {
                var reportId = list[i].reportId;
                report(reportId, b);
                $(".video-box").style.display = "none";
                $(".pop1-box").style.display = "none";
              };
              $(".submit1-pop2").onclick = function () {
                $(".pop1-box").style.display = "none";
              };
              $(".back-pop1").onclick = function () {
                $(".pop1-box").style.display = "none";
              };
            }
          };
        }
      } else if ($(".select").value == "1") {
        $(".video-box").style.display = "none";
        let commentId = list[i].commentId;
        console.log(commentId);
        var x = 4;
        if ((x = 4)) {
          $(".form-pop").querySelector("p").innerHTML = "你确定要受理吗？";
          $(".pop-box").style.display = "block";
          $(".submit-pop1").onclick = function () {
            var reportId = list[i].reportId;
            report(reportId, b);
            if ($(".select").value == "1") {
              delete_comment(commentId);
            }
            $(".pop-box").style.display = "none";
          };
          $(".submit-pop2").onclick = function () {
            $(".pop-box").style.display = "none";
          };
          $(".back-pop").onclick = function () {
            $(".pop-box").style.display = "none";
          };
        }
      } else if ($(".select").value == "2") {
        $(".video-box").style.display = "none";
        let commentId = list[i].commentId;
        console.log(commentId);
        var x = 4;
        if ((x = 4)) {
          $(".form-pop").querySelector("p").innerHTML = "你确定要受理吗？";
          $(".pop-box").style.display = "block";
          $(".submit-pop1").onclick = function () {
            var reportId = list[i].reportId;
            report(reportId, b);
            if ($(".select").value == "2") {
              delete_commentSon(commentId);
            }
            $(".pop-box").style.display = "none";
          };
          $(".submit-pop2").onclick = function () {
            $(".pop-box").style.display = "none";
          };
          $(".back-pop").onclick = function () {
            $(".pop-box").style.display = "none";
          };
        }
      }
    };
  }
  // 不受理举报
  var noreport_btn = document.querySelectorAll(".noreport-btn");
  console.log(noreport_btn);
  for (let i = 0; i < noreport_btn.length; i++) {
    // if (list[i].ofHandle != 0) {
    //   noreport_btn[i].disabled = true;

    // }
    noreport_btn[i].onclick = function () {
      var x = 2;
      if ((x = 2)) {
        console.log(x);
        $(".form-pop").querySelector("p").innerHTML = "你确定不受理吗？";
        $(".pop-box").style.display = "block";
        $(".submit-pop1").onclick = function () {
          var reportId = list[i].reportId;
          noreport(reportId, b);
          $(".pop-box").style.display = "none";
        };
        $(".submit-pop2").onclick = function () {
          $(".pop-box").style.display = "none";
        };
        $(".back-pop").onclick = function () {
          $(".pop-box").style.display = "none";
        };
      }
    };
  }
  //  分页的总量
  var pageTotal = data.data.data.object.pageTotal;
  var pageTotalCount = data.data.data.object.pageTotalCount;

  // 跳转按钮
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  $(".nowpage-btn-1").onclick = function () {
    $(".nowpage-1").innerHTML =
      $(".nowpage").value > pageTotal ? pageTotal : $(".nowpage").value;
    fenye($(".nowpage-1").innerHTML, $(".pageSize").value);
  };
  $(".total").innerHTML = `共${pageTotal}页共${pageTotalCount}条数据`;
  if (pageTotal < 3) {
    for (let i = 0; i < pageTotal; i++) {
      let a = ` <a href="JavaScript:;" class='pagebtn'>${i + 1}</a>`;
      $(".pageye").insertAdjacentHTML("beforeend", a);
    }
  } else {
    for (let i = 0; i < 3; i++) {
      let a = ` <a href="JavaScript:;" class='pagebtn'>${i + 1}</a>`;
      $(".pageye").insertAdjacentHTML("beforeend", a);
    }
    var pagebtnAll = document.querySelectorAll(".pagebtn");
    if ($(".nowpage").value >= 3) {
      let c = $(".nowpage").value;
      let a = c >= pageTotal - 1 ? (c = pageTotal - 1) : c;
      pagebtnAll[0].innerHTML = a - 1;
      pagebtnAll[1].innerHTML = a;
      pagebtnAll[2].innerHTML = ++a;
    }
  }
  var pagebtnAll = document.querySelectorAll(".pagebtn");
  for (let i = 0; i < pagebtnAll.length; i++) {
    pagebtnAll[i].onclick = function () {
      b(this.innerHTML, $(".pageSize").value);
      $(".nowpage-1").innerHTML = `${this.innerHTML}`;
      $(".nowpage").value = $(".nowpage-1").innerHTML;
    };
    if (pagebtnAll[i].innerHTML == $(".nowpage-1").innerHTML) {
      pagebtnAll[i].style.backgroundColor = "rgb(202,170,145)";
    } else if (pagebtnAll[i].innerHTML == $(".nowpage").value) {
      for (let j = 0; j < pagebtnAll.length; j++) {
        pagebtnAll[j].style.backgroundColor = "";
      }
      pagebtnAll[i].style.backgroundColor = "rgb(202,170,145)";
    }
  }
  $("#next").onclick = function () {
    var x = $(".nowpage-1").innerHTML;
    x++;
    var y = x >= pageTotal ? (x = pageTotal) : x;
    $(".nowpage-1").innerHTML = `${y}`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b($(".nowpage-1").innerHTML, $(".pageSize").value);
    console.log($(".nowpage-1").innerHTML, $(".nowpage").value);
    console.log($(".nowpage").value);
  };
  $("#pre").onclick = function () {
    var x = $(".nowpage-1").innerHTML;
    x--;
    var y = x <= 1 ? (x = 1) : x;
    $(".nowpage-1").innerHTML = `${y}`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b($(".nowpage-1").innerHTML, $(".pageSize").value);
  };
  $(".frist").onclick = function () {
    $(".nowpage-1").innerHTML = `1`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b(1, $(".pageSize").value);
  };
  $(".last").onclick = function () {
    $(".nowpage-1").innerHTML = `${pageTotal}`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b(pageTotal, $(".pageSize").value);
  };

  // 复选框
  var checkbox = document.querySelectorAll(".chexkbox");
  $("#checkbox-all").onclick = function () {
    if ($("#checkbox-all").checked) {
      for (let i = 0; i < checkbox.length; i++) {
        checkbox[i].checked = "checked";
      }
    } else {
      for (let i = 0; i < checkbox.length; i++) {
        checkbox[i].checked = "";
      }
    }
  };
  $(".delete-all").onclick = function () {
    var x = 2;
    if ((x = 2)) {
      console.log(x);
      $(".form-pop").querySelector("p").innerHTML = "你确定要批量删除吗？";
      $(".pop-box").style.display = "block";
      $(".submit-pop1").onclick = function () {
        var reportId = [];
        for (let i = 0; i < checkbox.length; i++) {
          if (checkbox[i].checked) {
            reportId += list[i].reportId + ",";
          }
        }
        delete_reportAll(reportId, b);
        $(".pop-box").style.display = "none";
      };
      $(".submit-pop2").onclick = function () {
        $(".pop-box").style.display = "none";
      };
      $(".back-pop").onclick = function () {
        $(".pop-box").style.display = "none";
      };
    }
  };
}
// // 分页数据
function commentlist(data, b) {
  let list = data.data.data.object.list;
  let pageNow = data.data.data.object.pageNow;
  for (let i = 0; i < list.length; i++) {
    $(".thead").innerHTML = `<tr>
    <th><input name="checkbox" type="checkbox" value="checkbox" id="checkbox-all" /></th>
    <th>#</th>
    <th>视频名称</th>
    <th>视频封面</th>
    <th>视频地址</th>
    <th>举报人头像</th>
    <th>举报人</th>
    <th>举报时间</th>
    <th>举报内容</th>
    <th>是否处理</th>
    <th>操作</th>
</tr>`;
    var ofHandle;
    if (list[i].ofHandle == 0) {
      ofHandle = "未处理";
    } else if (list[i].ofHandle == 1) {
      ofHandle = "受理";
    } else {
      ofHandle = "不受理";
    }
    let tds = ` <tr>
          <td><input name="checkbox" type="checkbox" value="checkbox" class="chexkbox" /></td>
          <td>${i + 1 + (pageNow - 1) * $(".pageSize").value}</td>
          <td>${list[i].videoName == null ? "无" : list[i].videoName}</td>
          <td><img src="${
            list[i].videoPhoto == null ? "#" : list[i].videoPhoto
          }"  style="width:50px; height:50px" class="photo11"></td>
          <td><a href='${
            list[i].videoPath == null ? "#" : list[i].videoPath
          }' style="text-decoration: none; font-weight:600;">${
      list[i].videoPath == null ? "无" : "链接"
    }</a></td>
          <td><img src="${
            list[i].userSrc == "未上传" ? "#" : list[i].userSrc
          }" style="width:40px;height:40px;border-radius: 50%;"></img></td>
          <td>${list[i].userNickname == null ? "无" : list[i].userNickname}</td>
          <td>${list[i].reportTime == null ? "无" : list[i].reportTime}</td>
          <td>${list[i].content == null ? "无" : str(list[i].content)}</td>
          <td>${ofHandle}</td>
          <td><button class='delete-btn'><i class="fa fa-trash-o" aria-hidden="true"></i> 删除</button></td>
      </tr>`;
    $("tbody").insertAdjacentHTML("beforeend", tds);
    var tbr = tbody.querySelectorAll("tr");
    if (i % 2 == 0) {
      tbr[i].style.backgroundColor = "rgb(220, 220, 220)";
      tbr[i].onmouseover = function () {
        this.style.backgroundColor = "rgb(202, 170, 145)";
      };
      tbr[i].onmouseout = function () {
        this.style.backgroundColor = "rgb(220, 220, 220)";
      };
    }
  }
  displayphoto1(".photo11", list);
  // 删除按钮绑定
  var del_btn = document.querySelectorAll(".delete-btn");
  for (let i = 0; i < del_btn.length; i++) {
    del_btn[i].onclick = function () {
      var x = 2;
      if ((x = 2)) {
        console.log(x);
        $(".form-pop").querySelector("p").innerHTML = "你确定要删除吗？";
        $(".pop-box").style.display = "block";
        $(".submit-pop1").onclick = function () {
          var reportId = list[i].reportId;
          delete_report(reportId, b);
          $(".pop-box").style.display = "none";
        };
        $(".submit-pop2").onclick = function () {
          $(".pop-box").style.display = "none";
        };
        $(".back-pop").onclick = function () {
          $(".pop-box").style.display = "none";
        };
      }
    };
  }

  //  分页的总量
  var pageTotal = data.data.data.object.pageTotal;
  var pageTotalCount = data.data.data.object.pageTotalCount;

  // 跳转按钮
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  $(".nowpage-btn-1").onclick = function () {
    $(".nowpage-1").innerHTML =
      $(".nowpage").value > pageTotal ? pageTotal : $(".nowpage").value;
    fenye($(".nowpage-1").innerHTML, $(".pageSize").value);
  };
  $(".total").innerHTML = `共${pageTotal}页共${pageTotalCount}条数据`;
  if (pageTotal < 3) {
    for (let i = 0; i < pageTotal; i++) {
      let a = ` <a href="JavaScript:;" class='pagebtn'>${i + 1}</a>`;
      $(".pageye").insertAdjacentHTML("beforeend", a);
    }
  } else {
    for (let i = 0; i < 3; i++) {
      let a = ` <a href="JavaScript:;" class='pagebtn'>${i + 1}</a>`;
      $(".pageye").insertAdjacentHTML("beforeend", a);
    }
    var pagebtnAll = document.querySelectorAll(".pagebtn");
    if ($(".nowpage").value >= 3) {
      let c = $(".nowpage").value;
      let a = c >= pageTotal - 1 ? (c = pageTotal - 1) : c;
      pagebtnAll[0].innerHTML = a - 1;
      pagebtnAll[1].innerHTML = a;
      pagebtnAll[2].innerHTML = ++a;
    }
  }
  var pagebtnAll = document.querySelectorAll(".pagebtn");
  for (let i = 0; i < pagebtnAll.length; i++) {
    pagebtnAll[i].onclick = function () {
      b(this.innerHTML, $(".pageSize").value);
      $(".nowpage-1").innerHTML = `${this.innerHTML}`;
      $(".nowpage").value = $(".nowpage-1").innerHTML;
    };
    if (pagebtnAll[i].innerHTML == $(".nowpage-1").innerHTML) {
      pagebtnAll[i].style.backgroundColor = "rgb(202,170,145)";
    } else if (pagebtnAll[i].innerHTML == $(".nowpage").value) {
      for (let j = 0; j < pagebtnAll.length; j++) {
        pagebtnAll[j].style.backgroundColor = "";
      }
      pagebtnAll[i].style.backgroundColor = "rgb(202,170,145)";
    }
  }
  $("#next").onclick = function () {
    var x = $(".nowpage-1").innerHTML;
    x++;
    var y = x >= pageTotal ? (x = pageTotal) : x;
    $(".nowpage-1").innerHTML = `${y}`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b($(".nowpage-1").innerHTML, $(".pageSize").value);
    console.log($(".nowpage-1").innerHTML, $(".nowpage").value);
    console.log($(".nowpage").value);
  };
  $("#pre").onclick = function () {
    var x = $(".nowpage-1").innerHTML;
    x--;
    var y = x <= 1 ? (x = 1) : x;
    $(".nowpage-1").innerHTML = `${y}`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b($(".nowpage-1").innerHTML, $(".pageSize").value);
  };
  $(".frist").onclick = function () {
    $(".nowpage-1").innerHTML = `1`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b(1, $(".pageSize").value);
  };
  $(".last").onclick = function () {
    $(".nowpage-1").innerHTML = `${pageTotal}`;
    $(".nowpage").value = $(".nowpage-1").innerHTML;
    b(pageTotal, $(".pageSize").value);
  };

  // 复选框
  var checkbox = document.querySelectorAll(".chexkbox");
  $("#checkbox-all").onclick = function () {
    if ($("#checkbox-all").checked) {
      for (let i = 0; i < checkbox.length; i++) {
        checkbox[i].checked = "checked";
      }
    } else {
      for (let i = 0; i < checkbox.length; i++) {
        checkbox[i].checked = "";
      }
    }
  };
  $(".delete-all").onclick = function () {
    var x = 2;
    if ((x = 2)) {
      console.log(x);
      $(".form-pop").querySelector("p").innerHTML = "你确定要批量删除吗？";
      $(".pop-box").style.display = "block";
      $(".submit-pop1").onclick = function () {
        var reportId = [];
        for (let i = 0; i < checkbox.length; i++) {
          if (checkbox[i].checked) {
            reportId += list[i].reportId + ",";
          }
        }
        delete_reportAll(reportId, b);
        $(".pop-box").style.display = "none";
      };
      $(".submit-pop2").onclick = function () {
        $(".pop-box").style.display = "none";
      };
      $(".back-pop").onclick = function () {
        $(".pop-box").style.display = "none";
      };
    }
  };
}
// // 渲染主评论数据
function comment(a, b) {
  axios({
    method: "get",
    url: "/video/findReportsComment",
    params: {
      commentType: 0,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      $("tbody").innerHTML = "";
      $(".pageye").innerHTML = "";
      console.log(data.data.data.object.list);
      list(data, comment);
    })
    .catch((err) => {
      console.log(err);
    });
}
// // 渲染子评论数据
function commentSon(a, b) {
  axios({
    method: "get",
    url: "/video/findReportsComment",
    params: {
      commentType: 1,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      $("tbody").innerHTML = "";
      $(".pageye").innerHTML = "";
      console.log(data.data.data.object.list);
      list(data, commentSon);
    })
    .catch((err) => {
      console.log(err);
    });
}

// 受理举报
function report(reportId, b) {
  axios({
    method: "put",
    url: "/video/updateReportOne",
    params: {
      reportId: reportId,
    },
  })
    .then(function (data) {
      $(
        ".not"
      ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>受理成功`;
      $(".not").style.display = "";
      setTimeout(() => {
        $(".not").style.display = "none";
      }, 1500);
      b($(".nowpage-1").innerHTML, $(".pageSize").value);
    })
    .catch((err) => {
      console.log(err);
    });
}
// 不受理举报
function noreport(reportId, b) {
  axios({
    method: "put",
    url: "/video/updateReportTwo",
    params: {
      reportId: reportId,
    },
  })
    .then(function (data) {
      $(
        ".not"
      ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>不受理成功`;
      $(".not").style.display = "";
      setTimeout(() => {
        $(".not").style.display = "none";
      }, 1500);
      b($(".nowpage-1").innerHTML, $(".pageSize").value);
    })
    .catch((err) => {
      console.log(err);
    });
}
// 删除单个数据
function delete_report(reportId, b) {
  axios({
    method: "delete",
    url: "/video/deleteReportRecord",
    params: {
      reportId: reportId,
    },
  })
    .then(function (data) {
      $(
        ".not"
      ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>删除成功`;
      $(".not").style.display = "";
      setTimeout(() => {
        $(".not").style.display = "none";
      }, 1500);
      b($(".nowpage-1").innerHTML, $(".pageSize").value);
    })
    .catch((err) => {
      console.log(err);
    });
}
// 批量删除数据
function delete_reportAll(reportId, b) {
  axios({
    method: "delete",
    url: "/video/deleteReportList",
    params: {
      reportId: reportId,
    },
  })
    .then(function (data) {
      $(
        ".not"
      ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>删除成功`;
      $(".not").style.display = "";
      setTimeout(() => {
        $(".not").style.display = "none";
      }, 1500);
      b($(".nowpage-1").innerHTML, $(".pageSize").value);
    })
    .catch((err) => {
      console.log(err);
    });
}
// 模糊查询视频举报通过账号昵称
function searchByAccountAndNickname(a, b) {
  var search_input = document.querySelector("#search");
  axios({
    method: "get",
    url: "/video/findReportVideoByNicknameAndAccount",
    params: {
      nickname: search_input.value,
      account: search_input.value,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      console.log(data.data.data.object.list);
      if (data.data.data.object.list.length == 0) {
        console.log(123123123123);
        $("#search").value = "";
        $(".pageSize1").style.display = "none";
        $(".pageSize").style.display = "";
        $(".nowpage-btn-2").style.display = "none";
        $(".nowpage-btn-1").style.display = "";
        $(
          ".not"
        ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
        $(".not").style.display = "";
        setTimeout(() => {
          $(".not").style.display = "none";
        }, 1500);
      } else {
        $("tbody").innerHTML = "";
        $(".pageye").innerHTML = "";
        $(".pageSize1").style.display = "";
        $(".pageSize").style.display = "none";
        $(".nowpage-btn-2").style.display = "";
        $(".nowpage-btn-1").style.display = "none";
        list(data, searchByAccountAndNickname);
      }
    })
    .catch((err) => {
      console.log(err);
    });
}
$(".search-btn").addEventListener("click", function () {
  console.log(111);
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  var search_input = document.querySelector("#search");
  if (search_input.value == "") {
    console.log(123123123123);
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
  } else {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>搜索成功`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
    searchByAccountAndNickname(1, $(".pageSize").value);
  }
});
// 模糊查询通过视频举报内容
function searchByContent(a, b) {
  var search1_input = document.querySelector("#search1");
  axios({
    method: "get",
    url: "/video/findReportVideoByContent",
    params: {
      content: search1_input.value,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      console.log(data.data.data.object.list);
      if (data.data.data.object.list.length == 0) {
        $("#search1").value = "";
        $(".pageSize1").style.display = "none";
        $(".pageSize").style.display = "";
        $(".nowpage-btn-2").style.display = "none";
        $(".nowpage-btn-1").style.display = "";
        $(
          ".not"
        ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
        $(".not").style.display = "";
        setTimeout(() => {
          $(".not").style.display = "none";
        }, 1500);
      } else {
        $("tbody").innerHTML = "";
        $(".pageye").innerHTML = "";
        $(".pageSize1").style.display = "";
        $(".pageSize").style.display = "none";
        $(".nowpage-btn-2").style.display = "";
        $(".nowpage-btn-1").style.display = "none";
        list(data, searchByContent);
      }
    })
    .catch((err) => {
      console.log(err);
    });
}
$(".search1-btn").addEventListener("click", function () {
  console.log(111);
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  var search1_input = document.querySelector("#search1");
  if (search1_input.value == "") {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
  } else {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>搜索成功`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
    searchByContent(1, $(".pageSize").value);
  }
});

// 模糊查询评论举报通过账号昵称
function searchcommentByAccountAndNickname(a, b) {
  var search2_input = document.querySelector("#search2");
  axios({
    method: "get",
    url: "/video/findReportCommentByNicknameAndAccount",
    params: {
      nickname: search2_input.value,
      account: search2_input.value,
      commentType: 0,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      console.log(data.data.data.object.list);
      if (data.data.data.object.list.length == 0) {
        console.log(123123123123);
        $("#search2").value = "";
        $(".pageSize1").style.display = "none";
        $(".pageSize").style.display = "";
        $(".nowpage-btn-2").style.display = "none";
        $(".nowpage-btn-1").style.display = "";
        $(
          ".not"
        ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
        $(".not").style.display = "";
        setTimeout(() => {
          $(".not").style.display = "none";
        }, 1500);
      } else {
        $("tbody").innerHTML = "";
        $(".pageye").innerHTML = "";
        $(".pageSize1").style.display = "";
        $(".pageSize").style.display = "none";
        $(".nowpage-btn-2").style.display = "";
        $(".nowpage-btn-1").style.display = "none";
        list(data, searchcommentByAccountAndNickname);
      }
    })
    .catch((err) => {
      console.log(err);
    });
}
$(".search2-btn").addEventListener("click", function () {
  console.log();
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  var search2_input = document.querySelector("#search2");
  if (search2_input.value == "") {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
  } else {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>搜索成功`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
    searchcommentByAccountAndNickname(1, $(".pageSize").value);
  }
});
// 模糊查询通过评论举报内容
function searchcommentByContent(a, b) {
  var search3_input = document.querySelector("#search3");
  axios({
    method: "get",
    url: "/video/findReportCommentByContent",
    params: {
      content: search3_input.value,
      commentType: 0,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      console.log(data.data.data.object.list);
      if (data.data.data.object.list.length == 0) {
        $("#search3").value = "";
        $(".pageSize1").style.display = "none";
        $(".pageSize").style.display = "";
        $(".nowpage-btn-2").style.display = "none";
        $(".nowpage-btn-1").style.display = "";
        $(
          ".not"
        ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
        $(".not").style.display = "";
        setTimeout(() => {
          $(".not").style.display = "none";
        }, 1500);
      } else {
        $("tbody").innerHTML = "";
        $(".pageye").innerHTML = "";
        $(".pageSize1").style.display = "";
        $(".pageSize").style.display = "none";
        $(".nowpage-btn-2").style.display = "";
        $(".nowpage-btn-1").style.display = "none";
        list(data, searchcommentByContent);
      }
    })
    .catch((err) => {
      console.log(err);
    });
}
$(".search3-btn").addEventListener("click", function () {
  console.log(111);
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  var search3_input = document.querySelector("#search3");
  if (search3_input.value == "") {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
  } else {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>搜索成功`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
    searchcommentByContent(1, $(".pageSize").value);
  }
});

// 模糊查询评论举报通过账号昵称
function searchcommentSonByAccountAndNickname(a, b) {
  var search4_input = document.querySelector("#search4");
  axios({
    method: "get",
    url: "/video/findReportCommentByNicknameAndAccount",
    params: {
      nickname: search4_input.value,
      account: search4_input.value,
      commentType: 1,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      console.log(data.data.data.object.list);
      if (data.data.data.object.list.length == 0) {
        console.log(123123123123);
        $("#search4").value = "";
        $(".pageSize1").style.display = "none";
        $(".pageSize").style.display = "";
        $(".nowpage-btn-2").style.display = "none";
        $(".nowpage-btn-1").style.display = "";
        $(
          ".not"
        ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
        $(".not").style.display = "";
        setTimeout(() => {
          $(".not").style.display = "none";
        }, 1500);
      } else {
        $("tbody").innerHTML = "";
        $(".pageye").innerHTML = "";
        $(".pageSize1").style.display = "";
        $(".pageSize").style.display = "none";
        $(".nowpage-btn-2").style.display = "";
        $(".nowpage-btn-1").style.display = "none";
        list(data, searchcommentSonByAccountAndNickname);
      }
    })
    .catch((err) => {
      console.log(err);
    });
}
$(".search4-btn").addEventListener("click", function () {
  console.log();
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  var search4_input = document.querySelector("#search4");
  if (search4_input.value == "") {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
  } else {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>搜索成功`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
    searchcommentSonByAccountAndNickname(1, $(".pageSize").value);
  }
});
// 模糊查询通过评论举报内容
function searchcommentSonByContent(a, b) {
  var search5_input = document.querySelector("#search5");
  axios({
    method: "get",
    url: "/video/findReportCommentByContent",
    params: {
      content: search5_input.value,
      commentType: 1,
      pageNow: a,
      pageSize: b,
    },
  })
    .then(function (data) {
      console.log(data.data.data.object.list);
      if (data.data.data.object.list.length == 0) {
        $("#search5").value = "";
        $(".pageSize1").style.display = "none";
        $(".pageSize").style.display = "";
        $(".nowpage-btn-2").style.display = "none";
        $(".nowpage-btn-1").style.display = "";
        $(
          ".not"
        ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
        $(".not").style.display = "";
        setTimeout(() => {
          $(".not").style.display = "none";
        }, 1500);
      } else {
        $("tbody").innerHTML = "";
        $(".pageye").innerHTML = "";
        $(".pageSize1").style.display = "";
        $(".pageSize").style.display = "none";
        $(".nowpage-btn-2").style.display = "";
        $(".nowpage-btn-1").style.display = "none";
        list(data, searchcommentSonByContent);
      }
    })
    .catch((err) => {
      console.log(err);
    });
}
$(".search5-btn").addEventListener("click", function () {
  console.log(111);
  $(".nowpage-1").innerHTML = 1;
  $(".nowpage").value = $(".nowpage-1").innerHTML;
  var search5_input = document.querySelector("#search5");
  if (search5_input.value == "") {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-exclamation-circle" style="color: rgb(255, 187, 0);" aria-hidden="true"></i>抱歉找不到`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
  } else {
    $(
      ".not"
    ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>搜索成功`;
    $(".not").style.display = "";
    setTimeout(() => {
      $(".not").style.display = "none";
    }, 1500);
    searchcommentSonByContent(1, $(".pageSize").value);
  }
});

// 视频举报审核删除单个数据
function delete_video(videoId) {
  axios({
    method: "delete",
    url: "/videoCRUD/deleteVideo",
    params: {
      videoId: videoId,
    },
  })
    .then(function (data) {
      // $(
      //   ".not"
      // ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>删除成功`;
      // $(".not").style.display = "";
      // setTimeout(() => {
      //   $(".not").style.display = "none";
      // }, 1500);
    })
    .catch((err) => {
      console.log(err);
    });
}

// 单个子评论删除
function delete_commentSon(a) {
  axios({
    method: "delete",
    url: "/deleteCommentSonByCommentSonId",
    params: {
      commentSonId: a,
    },
  })
    .then(function (data) {
      let da = data.data.data.object;
      $(
        ".not"
      ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>删除成功`;
      $(".not").style.display = "";
      setTimeout(() => {
        $(".not").style.display = "none";
      }, 1500);
    })
    .catch((err) => {
      console.log(err);
    });
}

// 评论举报受理成功删除单个数据
function delete_comment(commentId) {
  axios({
    method: "delete",
    url: "/deleteCommentByCommentId",
    params: {
      commentId: commentId,
    },
  })
    .then(function (data) {
      $(
        ".not"
      ).innerHTML = `<i class="fa fa-check" aria-hidden="true" style="color:green"></i>删除成功`;
      $(".not").style.display = "";
      setTimeout(() => {
        $(".not").style.display = "none";
      }, 1500);
    })
    .catch((err) => {
      console.log(err);
    });
}
